const { defineConfig } = require('@vue/cli-service')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = defineConfig({
  runtimeCompiler: true,
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    proxy: {
      '/yd': {
        target: 'http://localhost:9001',
        ws: true,
        secure:false,
        changeOrgin:true,
        pathRewrite: {
          '^/yd': ''
        }
      }
    }
  },
  configureWebpack: {
    resolve: {
      alias: {},
      fallback: {
        //其他的如果不启用可以用 keyname :false，例如：crypto:false, 
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify")
      },
    },
    plugins: [
      new MonacoWebpackPlugin(), new NodePolyfillPlugin()
    ]
  }
})